#include <iostream>
#include <string>
#include <unordered_set>
#include <algorithm>
using namespace std;

int n;

int main()
{
	cin >> n;
	unordered_set<string> hash;

	while (n--)
	{
		string s;
		cin >> s;

		sort(s.begin(), s.end());

		hash.insert(s);
	}

	cout << hash.size();

	return 0;
}